<?php namespace Home\Controller;
use Hdphp\Controller\Controller;
/*
 * 文章控制器
 * */
	 class ContentController extends CommonController
	 {
	 	public function index()
		{
			$aid = Q("get.aid",0,"intval");
			//获得数据
			$contentData = Db::table("article_data")
						 ->join('article',"article.aid","=","article_data.article_aid")
						 ->where("article_aid",$aid)
						 ->first();
			
			$contentData["total"] = Db::table("tag")
								  ->join("article_tag","article_tag.tag_tid","=","tid")
								  ->where("article_tag.article_aid",$contentData['aid'])
								  ->lists("tid,tname");
			
			//p($contentData);die;
			View::with('contentData',$contentData);
			View::make("content");
		}
	 }
